package yang.VirtualMachine.chapter9.classStruct;

import java.io.IOException;
import java.io.InputStream;

import yang.VirtualMachine.chapter9.ClassBean;
import yang.VirtualMachine.chapter9.ClassUtil;
import yang.VirtualMachine.chapter9.Processer;

public class MagicNumberProcesser implements Processer {

	@Override
	public void process(InputStream input) throws IOException {
		byte[] dest = new byte[4];
		input.read(dest);
		Long l = ClassUtil.getNumByBytes(dest);
		String magicNum = Long.toHexString(l).toUpperCase();
		System.out.println(magicNum);
		
		ClassBean.getInstance().magicNumber = magicNum;
	}

}
